<template>
	<view class="content">
		<!-- 顶部导航tab -->
		<view class="tabs">
			<view class="a">
				<text
					v-for="(item, index) in tabList"
					:key="index"
					:class="{'active-tab': tabIndex === index}"
					@click="tabIndex = index"
					class="tab-item"
				>
					{{ item }}
				</text>
			</view>
		</view>
		
		<!-- 轮播banner -->
		<view class="swiper-banner">
			<uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
				<swiper class="swiper-box">
					<swiper-item v-for="(item ,index) in info" :key="index">
						<view class="swiper-item">
							{{item.content}}
						</view>
					</swiper-item>
				</swiper>
			</uni-swiper-dot>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabIndex: 0,
				tabList: ['夏季糖水', '冬季糖水', '双皮奶', '西米露', '小吃', '酒水饮料', '炒饭'],
				
				info: [{
					content: ''
				}, {
					content: ''
				}, {
					content: ''
				}],
				current: 0,
				mode: 'round',
			}
		},
		onLoad() {

		},
		methods: {

		}
	}
</script>

<style lang="less" scoped>
	.content {
		width: 100vw;
		height: 100vh;
		box-sizing: border-box;

		.tabs {
			overflow-x: scroll;
			margin: 0 20rpx;
			padding: 20rpx 0;
			.a {
				display: flex;
				width: max-content;
				flex-wrap: nowrap;

				.tab-item {
					margin-left: 12rpx;
					font-size: 35rpx;
					font-weight: 500;
					color: #000;
					font-family: 'PingFang SC';
				}

				.active-tab {
					color: #8f8f94;
				}
			}
		}
		.swiper-banner {
			width: 90vw;
			height: 10vw;
			margin: 0 auto;
			.swiper-item {
				width: 90vw;
				height: 200rpx;
				border-radius: 30rpx;
				background-color: #8f8f94;
			}
		}
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		/* margin-top: 200rpx; */
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>